<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>${SYSTEM_NAME}-后台管理中心</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/login.css?v=${FILE_VERSION}" media="all">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/captcha/verify.css?v=${FILE_VERSION}" media="all">
  <style>
    /*设置验证码滑块和用户名输入框一样长*/
    .nc-container .nc_wrapper {
      width: auto !important;
    }
    .sendSmsCodeButton{
      position: absolute;right: 0px;top:0px;
    }
  </style>
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

  <div class="layadmin-user-login-main">
    <div class="layadmin-user-login-box layadmin-user-login-header">
      <h2>${SYSTEM_NAME}</h2>
      <p>后台管理中心</p>
    </div>
    <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
      <div class="layui-form-item">
        <div id="errorMsg" style="color: red"></div>
      </div>
      <%--      用户名密码登录面板--%>
      <div class="layui-row loginPanel" id="userPwdPanel">
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
          <input type="text" name="username" id="LAY-user-login-username" placeholder="用户名" class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
          <input type="password" name="password" id="LAY-user-login-password"  placeholder="密码" class="layui-input">
        </div>
      </div>

      <%--      手机验证码登录面板--%>
      <div class="layui-row loginPanel" id="phoneCodePanel" style="display: none;">
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="login-phone"></label>
          <input type="text" name="username" id="login-phone" placeholder="手机号" class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="login-phoneVercode"></label>
          <input type="password" name="password" id="login-phoneVercode"  placeholder="验证码" class="layui-input">
          <button class="layui-btn layui-btn-primary layui-border-green sendSmsCodeButton" onclick="sendSmsCode(this)">发送验证码</button>
        </div>
      </div>
      <%--      忘记密码面板--%>
      <div class="layui-row loginPanel" id="forgotPwdPanel" style="display: none;">
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="forgot-phone"></label>
          <input type="text" name="username" id="forgot-phone" placeholder="手机号" class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="forgot-phoneVercode"></label>
          <input type="password" name="password" id="forgot-phoneVercode"  placeholder="验证码" class="layui-input">
          <button class="layui-btn layui-btn-primary layui-border-green sendSmsCodeButton" onclick="sendSmsCode(this,'forgotVercode')">发送验证码</button>
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="forgot-newPwd"></label>
          <input type="password" name="password" id="forgot-newPwd"  placeholder="请输入新密码" class="layui-input">
        </div>
        <div class="layui-form-item">
          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="forgot-repeatNewPwd"></label>
          <input type="password" name="password" id="forgot-repeatNewPwd"  placeholder="请再次输入新密码" class="layui-input">
        </div>
      </div>

      <c:if test="${VC_CODE == 'true'}">
        <c:if test="${VC_CODE_TYPE == '1'}">
          <div class="layui-form-item vercodeBox">
            <div class="layui-row">
              <div class="layui-col-xs7">
                <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                <input type="text" maxlength="4" id="LAY-user-login-vercode" placeholder="图形验证码" class="layui-input">
              </div>
              <div class="layui-col-xs5">
                <div style="margin-left: 10px;">
                  <img src="${pageContext.request.contextPath}/manage/kaptcha.jpg" class="layadmin-user-login-codeimg" id="verCode" onclick="changeValidateCode()">
                </div>
              </div>
            </div>
          </div>
        </c:if>
        <c:if test="${VC_CODE_TYPE == '2'}">
          <div class="layui-form-item vercodeBox">
            <div id="point-yz-id" class="nc-container layui-form-item layui-input-icon-group"></div>
          </div>
        </c:if>
        <c:if test="${VC_CODE_TYPE == '3'}">
          <div class="layui-form-item vercodeBox">
            <input id="captchaVer" name="captchaVer" type="hidden">
            <div id="captchaContent" class="nc-container layui-form-item layui-input-icon-group"></div>
          </div>
        </c:if>
      </c:if>
      <c:if test="${LOGIN_SMS_CODE_OPEN == '1' || LOGIN_FORGOT_PWD_OPEN=='1'}">
        <div class="layui-form-item">
          <c:if test="${LOGIN_SMS_CODE_OPEN == '1'}">
            <a style="float:right;margin-left:20px;cursor: pointer;color: #009688;" data-openpanel="phoneCodePanel" onclick="changePanel(this,1)">短信验证码登录</a>
          </c:if>
          <c:if test="${LOGIN_FORGOT_PWD_OPEN=='1'}">
            <a style="float:left;cursor: pointer;color: #009688;" data-openpanel="forgotPwdPanel" onclick="changePanel(this,2)">忘记密码？</a>
          </c:if>
        </div>
      </c:if>
      <div class="layui-form-item">
        <button class="layui-btn layui-btn-fluid" id="loginBut" lay-submit lay-filter="LAY-user-login-submit">登 入</button>
      </div>
    </div>
  </div>
  <div class="layui-trans layadmin-user-login-footer">
    <!-- <p>© 2018 <a href="" target="_blank"></a></p> -->
  </div>
</div>
<input type="hidden" value="${VC_CODE_TYPE}" id="VC_CODE_TYPE">
<input type="hidden" value="${VC_CODE}" id="VC_CODE">
<input type="hidden" value="${pwdStrength}" id="pwdStrength">
<script src="${pageContext.request.contextPath}/static/js/crypto-js/crypto-js.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/crypto-js/md5.min.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/captcha/verify-source.js?v=${FILE_VERSION}"></script>
<script>
  var ua = window.navigator.userAgent.toLowerCase();
  /**
   * 此处根据不同终端来加载不同js，没用直接修改页面元素样式主要是因为修改不了，只在当前<style>里修改有效，js里在判断修改就不行
   **/
  if (ua.indexOf("iphone") > 0 || ua.indexOf("android") > 0) {
    $("body").append('<script src="${pageContext.request.contextPath}/static/js/vcCode/pointYz_mobile.js?v=${FILE_VERSION}"><\/script>');
  }else{
    $(".layadmin-user-login-main").addClass("pc_layadmin-user-login-main");
    $("body").append('<script src="${pageContext.request.contextPath}/static/js/vcCode/pointYz2.js?v=${FILE_VERSION}"><\/script>');
  }
</script>
<script src="${pageContext.request.contextPath}/static/js/common/login.js?v=${FILE_VERSION}"></script>
</body>
</html>